﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DataLib.DBUtility;//Please add references
using System.Collections.Generic;


namespace DataLib.DAL
{
	/// <summary>
	/// 数据访问类:ServerPoint
	/// </summary>
	public partial class ServerPoint
	{
		public ServerPoint()
		{}
        #region  BasicMethod

        /// <summary>
        /// 得到最大ID
        /// </summary>
        public int GetMaxId()
        {
            return DbHelperSQL.GetMaxID("ID", "ServerPoint");
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int? id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from ServerPoint");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DataLib.Model.ServerPoint model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into ServerPoint(");
            strSql.Append("ServerAreaID,AreaName,ServerPointName,LookSalesmanUserName,LookSalesmanTrueName,CjopersonUserName,CjopersonTrueName,PowerpersonTrueName,PowerpersonUserName,CreateTime,CreateMan,IsDel,Cjoperson_show)");
            strSql.Append(" values (");
            strSql.Append("@ServerAreaID,@AreaName,@ServerPointName,@LookSalesmanUserName,@LookSalesmanTrueName,@CjopersonUserName,@CjopersonTrueName,@PowerpersonTrueName,@PowerpersonUserName,@CreateTime,@CreateMan,@IsDel,@Cjoperson_show)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@ServerAreaID", SqlDbType.Int,4),
					new SqlParameter("@AreaName", SqlDbType.NVarChar,50),
					new SqlParameter("@ServerPointName", SqlDbType.NVarChar,50),
					new SqlParameter("@LookSalesmanUserName", SqlDbType.NVarChar,500),
					new SqlParameter("@LookSalesmanTrueName", SqlDbType.NVarChar,500),
					new SqlParameter("@CjopersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CjopersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CreateTime", SqlDbType.DateTime),
					new SqlParameter("@CreateMan", SqlDbType.VarChar,20),
					new SqlParameter("@IsDel", SqlDbType.Bit,1),
					new SqlParameter("@Cjoperson_show", SqlDbType.VarChar,20)};
            parameters[0].Value = model.ServerAreaID;
            parameters[1].Value = model.AreaName;
            parameters[2].Value = model.ServerPointName;
            parameters[3].Value = model.LookSalesmanUserName;
            parameters[4].Value = model.LookSalesmanTrueName;
            parameters[5].Value = model.CjopersonUserName;
            parameters[6].Value = model.CjopersonTrueName;
            parameters[7].Value = model.PowerpersonTrueName;
            parameters[8].Value = model.PowerpersonUserName;
            parameters[9].Value = model.CreateTime;
            parameters[10].Value = model.CreateMan;
            parameters[11].Value = model.IsDel;
            parameters[12].Value = model.Cjoperson_show;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DataLib.Model.ServerPoint model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update ServerPoint set ");
            strSql.Append("ServerAreaID=@ServerAreaID,");
            strSql.Append("AreaName=@AreaName,");
            strSql.Append("ServerPointName=@ServerPointName,");
            strSql.Append("LookSalesmanUserName=@LookSalesmanUserName,");
            strSql.Append("LookSalesmanTrueName=@LookSalesmanTrueName,");
            strSql.Append("CjopersonUserName=@CjopersonUserName,");
            strSql.Append("CjopersonTrueName=@CjopersonTrueName,");
            strSql.Append("PowerpersonTrueName=@PowerpersonTrueName,");
            strSql.Append("PowerpersonUserName=@PowerpersonUserName,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("CreateMan=@CreateMan,");
            strSql.Append("IsDel=@IsDel,");
            strSql.Append("Cjoperson_show=@Cjoperson_show");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ServerAreaID", SqlDbType.Int,4),
					new SqlParameter("@AreaName", SqlDbType.NVarChar,50),
					new SqlParameter("@ServerPointName", SqlDbType.NVarChar,50),
					new SqlParameter("@LookSalesmanUserName", SqlDbType.NVarChar,500),
					new SqlParameter("@LookSalesmanTrueName", SqlDbType.NVarChar,500),
					new SqlParameter("@CjopersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CjopersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CreateTime", SqlDbType.DateTime),
					new SqlParameter("@CreateMan", SqlDbType.VarChar,20),
					new SqlParameter("@IsDel", SqlDbType.Bit,1),
					new SqlParameter("@Cjoperson_show", SqlDbType.VarChar,20),
					new SqlParameter("@ID", SqlDbType.Int,4)};
            parameters[0].Value = model.ServerAreaID;
            parameters[1].Value = model.AreaName;
            parameters[2].Value = model.ServerPointName;
            parameters[3].Value = model.LookSalesmanUserName;
            parameters[4].Value = model.LookSalesmanTrueName;
            parameters[5].Value = model.CjopersonUserName;
            parameters[6].Value = model.CjopersonTrueName;
            parameters[7].Value = model.PowerpersonTrueName;
            parameters[8].Value = model.PowerpersonUserName;
            parameters[9].Value = model.CreateTime;
            parameters[10].Value = model.CreateMan;
            parameters[11].Value = model.IsDel;
            parameters[12].Value = model.Cjoperson_show;
            parameters[13].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int? id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from ServerPoint ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string IDlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from ServerPoint ");
            strSql.Append(" where ID in (" + IDlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public DataLib.Model.ServerPoint GetModel(int? id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 ID,ServerAreaID,AreaName,ServerPointName,LookSalesmanUserName,LookSalesmanTrueName,CjopersonUserName,CjopersonTrueName,PowerpersonTrueName,PowerpersonUserName,CreateTime,CreateMan,IsDel,Cjoperson_show from ServerPoint ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            DataLib.Model.ServerPoint model = new DataLib.Model.ServerPoint();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public DataLib.Model.ServerPoint DataRowToModel(DataRow row)
        {
            DataLib.Model.ServerPoint model = new DataLib.Model.ServerPoint();
            if (row != null)
            {
                if (row["ID"] != null && row["ID"].ToString() != "")
                {
                    model.id = int.Parse(row["ID"].ToString());
                }
                if (row["ServerAreaID"] != null && row["ServerAreaID"].ToString() != "")
                {
                    model.ServerAreaID = int.Parse(row["ServerAreaID"].ToString());
                }
                if (row["AreaName"] != null)
                {
                    model.AreaName = row["AreaName"].ToString();
                }
                if (row["ServerPointName"] != null)
                {
                    model.ServerPointName = row["ServerPointName"].ToString();
                }
                if (row["LookSalesmanUserName"] != null)
                {
                    model.LookSalesmanUserName = row["LookSalesmanUserName"].ToString();
                }
                if (row["LookSalesmanTrueName"] != null)
                {
                    model.LookSalesmanTrueName = row["LookSalesmanTrueName"].ToString();
                }
                if (row["CjopersonUserName"] != null)
                {
                    model.CjopersonUserName = row["CjopersonUserName"].ToString();
                }
                if (row["CjopersonTrueName"] != null)
                {
                    model.CjopersonTrueName = row["CjopersonTrueName"].ToString();
                }
                if (row["PowerpersonTrueName"] != null)
                {
                    model.PowerpersonTrueName = row["PowerpersonTrueName"].ToString();
                }
                if (row["PowerpersonUserName"] != null)
                {
                    model.PowerpersonUserName = row["PowerpersonUserName"].ToString();
                }
                if (row["CreateTime"] != null && row["CreateTime"].ToString() != "")
                {
                    model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
                }
                if (row["CreateMan"] != null)
                {
                    model.CreateMan = row["CreateMan"].ToString();
                }
                if (row["IsDel"] != null && row["IsDel"].ToString() != "")
                {
                    if ((row["IsDel"].ToString() == "1") || (row["IsDel"].ToString().ToLower() == "true"))
                    {
                        model.IsDel = true;
                    }
                    else
                    {
                        model.IsDel = false;
                    }
                }
                if (row["Cjoperson_show"] != null)
                {
                    model.Cjoperson_show = row["Cjoperson_show"].ToString();
                }
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ID,ServerAreaID,AreaName,ServerPointName,LookSalesmanUserName,LookSalesmanTrueName,CjopersonUserName,CjopersonTrueName,PowerpersonTrueName,PowerpersonUserName,CreateTime,CreateMan,IsDel,Cjoperson_show ");
            strSql.Append(" FROM ServerPoint ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" ID,ServerAreaID,AreaName,ServerPointName,LookSalesmanUserName,LookSalesmanTrueName,CjopersonUserName,CjopersonTrueName,PowerpersonTrueName,PowerpersonUserName,CreateTime,CreateMan,IsDel,Cjoperson_show ");
            strSql.Append(" FROM ServerPoint ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) FROM ServerPoint ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT * FROM ( ");
            strSql.Append(" SELECT ROW_NUMBER() OVER (");
            if (!string.IsNullOrEmpty(orderby.Trim()))
            {
                strSql.Append("order by T." + orderby);
            }
            else
            {
                strSql.Append("order by T.ID desc");
            }
            strSql.Append(")AS Row, T.*  from ServerPoint T ");
            if (!string.IsNullOrEmpty(strWhere.Trim()))
            {
                strSql.Append(" WHERE " + strWhere);
            }
            strSql.Append(" ) TT");
            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            SqlParameter[] parameters = {
                    new SqlParameter("@tblName", SqlDbType.VarChar, 255),
                    new SqlParameter("@fldName", SqlDbType.VarChar, 255),
                    new SqlParameter("@PageSize", SqlDbType.Int),
                    new SqlParameter("@PageIndex", SqlDbType.Int),
                    new SqlParameter("@IsReCount", SqlDbType.Bit),
                    new SqlParameter("@OrderType", SqlDbType.Bit),
                    new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
                    };
            parameters[0].Value = "ServerPoint";
            parameters[1].Value = "ID";
            parameters[2].Value = PageSize;
            parameters[3].Value = PageIndex;
            parameters[4].Value = 0;
            parameters[5].Value = 0;
            parameters[6].Value = strWhere;	
            return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
        }*/

        #endregion  BasicMethod
		#region  ExtensionMethod
        /// <summary>
        /// 取得同一个区域下的所有列表
        /// </summary>
        /// <param name="areaid"></param>
        /// <returns></returns>
        public List<Model.ServerPoint> getListModel(int areaid)
        {
            List<Model.ServerPoint> list = new List<Model.ServerPoint>();
            DataTable dt = new DataTable();
            dt = GetList(" ServerAreaID=" + areaid.ToString()).Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                { 
                    list.Add(DataRowToModel(dt.Rows[i]));
                }
            }

            return list;
        }


         // <summary>
        /// 增加一条数据
        /// </summary>
        public int AddByCicy(Model.ServerArea sa, string city, string cjocreate, string cjoshow, string cjoview, string cjoauth)
        {
            string citycode = new City().GetModelByName(city, "01").citycode;
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into ServerPoint(");
            strSql.Append("ServerAreaID,AreaName,ServerPointName,LookSalesmanUserName,LookSalesmanTrueName,CjopersonUserName,CjopersonTrueName,PowerpersonTrueName,PowerpersonUserName,CreateTime,CreateMan,IsDel,Cjoperson_show)");
            strSql.Append(" values (");
            strSql.Append("@ServerAreaID,@AreaName,@ServerPointName,@LookSalesmanUserName,@LookSalesmanTrueName,@CjopersonUserName,@CjopersonTrueName,@PowerpersonTrueName,@PowerpersonUserName,@CreateTime,@CreateMan,@IsDel,@Cjoperson_show)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@ServerAreaID", SqlDbType.Int,4),
					new SqlParameter("@AreaName", SqlDbType.NVarChar,50),
					new SqlParameter("@ServerPointName", SqlDbType.NVarChar,50),
					new SqlParameter("@LookSalesmanUserName", SqlDbType.NVarChar,500),
					new SqlParameter("@LookSalesmanTrueName", SqlDbType.NVarChar,500),
					new SqlParameter("@CjopersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CjopersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@CreateTime", SqlDbType.DateTime),
					new SqlParameter("@CreateMan", SqlDbType.VarChar,20),
					new SqlParameter("@IsDel", SqlDbType.Bit,1),
					new SqlParameter("@Cjoperson_show", SqlDbType.VarChar,50)};
            parameters[0].Value = sa.id;
            parameters[1].Value = sa.AreaName;
            parameters[2].Value = city;
            parameters[3].Value = GetBussmanByMul(cjoview, citycode, 0);
            parameters[4].Value = GetBussmanByMul(cjoview, citycode, 1);
            parameters[5].Value = GetBussmanByOne(cjocreate, citycode, 0); ;
            parameters[6].Value = GetBussmanByOne(cjocreate, citycode, 1); ;
            parameters[7].Value = GetBussmanByOne(cjoauth, citycode, 0);
            parameters[8].Value = GetBussmanByOne(cjoauth, citycode, 1);
            parameters[9].Value = DateTime.Now;
            parameters[10].Value = sa.CreateMan;
            parameters[11].Value = 0;
            parameters[12].Value = GetBussmanByOne(cjoshow, citycode, 0) + "/" + GetBussmanByOne(cjoshow, citycode, 1);

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }


        /// <summary>
        /// 根据点名称修改
        /// </summary>
        /// <param name="city">城市名称</param>
        /// <param name="cjocreate"></param>
        /// <param name="cjoshow"></param>
        /// <param name="cjoview"></param>
        /// <param name="cjoauth"></param>
        /// <returns></returns>
        public bool updatePointByCity(Model.ServerArea sa,string city,string cjocreate, string cjoshow,string cjoview,string cjoauth)
        {
            StringBuilder strSql = new StringBuilder();
            string citycode = "";
            citycode = new City().GetModelByName(city,"01").citycode;
            strSql.Append("update ServerPoint set ");
            strSql.Append("LookSalesmanUserName=@LookSalesmanUserName,");
            strSql.Append("LookSalesmanTrueName=@LookSalesmanTrueName,");
            strSql.Append("CjopersonUserName=@CjopersonUserName,");
            strSql.Append("CjopersonTrueName=@CjopersonTrueName,");
            strSql.Append("PowerpersonTrueName=@PowerpersonTrueName,");
            strSql.Append("PowerpersonUserName=@PowerpersonUserName,");
            strSql.Append("Cjoperson_show=@Cjoperson_show");
            strSql.Append(" where ServerPointName=@ServerPointName and ServerAreaID=@ServerAreaID");
            SqlParameter[] parameters = {
					new SqlParameter("@ServerPointName", SqlDbType.NVarChar,50),
					new SqlParameter("@LookSalesmanUserName", SqlDbType.NVarChar,500),
					new SqlParameter("@LookSalesmanTrueName", SqlDbType.NVarChar,500),
					new SqlParameter("@CjopersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@CjopersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonUserName", SqlDbType.NVarChar,50),
					new SqlParameter("@PowerpersonTrueName", SqlDbType.NVarChar,50),
					new SqlParameter("@Cjoperson_show", SqlDbType.VarChar,50),
                    new SqlParameter("@ServerAreaID", SqlDbType.Int)
                                        };
            parameters[0].Value = city;
            parameters[1].Value = GetBussmanByMul(cjoview, citycode, 0);
            parameters[2].Value = GetBussmanByMul(cjoview, citycode, 1);
            parameters[3].Value = GetBussmanByOne(cjocreate, citycode, 0);
            parameters[4].Value = GetBussmanByOne(cjocreate, citycode, 1); ;
            parameters[5].Value = GetBussmanByOne(cjoauth, citycode, 0);
            parameters[6].Value = GetBussmanByOne(cjoauth, citycode, 1);
            parameters[7].Value = GetBussmanByOne(cjoshow, citycode, 0) + "/" + GetBussmanByOne(cjoshow, citycode, 1);
            parameters[8].Value = sa.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
           
        }
        

        /// <summary>
        /// 根据多选分开
        /// </summary>
        /// <param name="strval"></param>
        /// <param name="citycode"></param>
        /// <param name="flag">0是用户名 1是真实姓名</param>
        /// <returns></returns>
        public string GetBussmanByMul(string strval, string citycode, int flag)
        {
            string sealman = "";
            string[] arrval = strval.Split('#');
            foreach (string str in arrval)
            {
                if (str.IndexOf(citycode) >= 0)
                {
                    if (flag == 0)
                    {
                        sealman = str.Substring(str.IndexOf("{") + 1, str.IndexOf(";") - str.IndexOf("{") - 1);
                    }
                    else
                    {
                        sealman = str.Substring(str.IndexOf(";") + 1, str.IndexOf("}") - str.IndexOf(";") - 1);
                    }
                }
            }
            return sealman;
        }

        /// <summary>
        /// 选择业务员 单选格式的
        /// </summary>
        /// <param name="strval"></param>
        /// <param name="citycode"></param>
        /// <param name="flag">0用户名，1真实姓名</param>
        /// <returns></returns>
        public string GetBussmanByOne(string strval, string citycode, int flag)
        {
            string sealman = "";
            string[] arrval = strval.Split(';');
            foreach (string str in arrval)
            {
                if (str.IndexOf(citycode) >= 0)
                {
                    if (flag == 0)
                    {
                        sealman = str.Substring(str.IndexOf("{") + 1, str.IndexOf(",") - str.IndexOf("{") - 1);
                    }
                    else
                    {
                        sealman = str.Substring(str.IndexOf(",") + 1, str.IndexOf("}") - str.IndexOf(",") - 1);
                    }
                }
            }
            return sealman;
        }

        /// <summary>
        /// 根据区域ID和服务点名称取得服务点
        /// </summary>
        /// <param name="areaid"></param>
        /// <param name="pointname"></param>
        /// <returns></returns>
        public Model.ServerPoint GetPointID(int? areaid, string pointname)
        {
            Model.ServerPoint model = new Model.ServerPoint();
            DataTable dt = GetList(" ServerAreaID=" + areaid.ToString() + " and ServerPointName='" + pointname + "'").Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                model = DataRowToModel(dt.Rows[0]);
            }
            else
            {
                model = null;
            }
            return model;
        }
		#endregion  ExtensionMethod
	}
}

